#ifndef INFOSHOWSERVER_H
#define INFOSHOWSERVER_H

#include <QWidget>
#include <QProcess>
#include <QTcpSocket>
#include <QMainWindow>
#include <QMap>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <form.h>
#include <formenvir.h>
#include <showtime.h>


namespace Ui {
class InfoShowServer;
}

class InfoShowServer : public QWidget
{
    Q_OBJECT

public:
    explicit InfoShowServer(QWidget *parent = 0);
    ~InfoShowServer();
protected:
    //void init_citykey();
signals:
    //void mysignal();//自定义信号，不需要实现

private slots:
    void start_process(int,QProcess::ExitStatus);
    void on_connectBt_clicked();
    void read_data();
    void on_updateBt_clicked();

    void read_weatherdata(QNetworkReply *reply);
    void read_environment(QNetworkReply *reply);
    void update_time(QString t);

private:
    Ui::InfoShowServer *ui;

    QProcess mprocess;
    QTcpSocket msocket;

    //QMap<QString, QString> citykey;
    QNetworkAccessManager manager;
    QNetworkAccessManager manager_envir;
    Form *items;
    FormEnvir *items_envir;

    ShowTime showTimeThread;

};

#endif // INFOSHOWSERVER_H
